﻿using NUnit.Framework;
using Smartkernel;
using Smartkernel.Extensions;

namespace Smartkernel.NUnitTest.Extensions
{
    [Category("Extensions")]
    [TestFixture]
    public class SmartInt64ExtensionTest
    {
        [Test]
        public void Test()
        {
            //【01】输出不同格式化形式（涉及方法：ToString）
            long i = 20080708L;
            Assert.AreEqual(i.ToString(SmartNumberFormatType.C), "￥20,080,708.00");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.D), "20080708");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.E), "2.008071E+007");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.G), "20080708");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.P), "2,008,070,800.00%");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.X), "1326844");
            Assert.AreEqual(i.ToString(SmartNumberFormatType.ChineseCurrency), "贰仟零佰零拾捌万零仟柒佰零拾捌元");
        }
    }
}
